home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / cdplay.exe / CD_VARS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-27  |  3KB  |  152 lines

  1. Unit CD_Vars;
  2.  
  3. Interface
  4.  
  5. Type
  6.   ListBuf    = Record
  7.     UnitCode : Byte;
  8.     UnitSeg,
  9.     UnitOfs  : Word;
  10.   end;
  11.   VTOCArray  = Array[1..2048] of Byte;
  12.   DriveByteArray = Array[1..128] of Byte;
  13.  
  14.   Req_Hdr    = Record
  15.      Len     : Byte;
  16.      SubUnit : Byte;
  17.      Command : Byte;
  18.      Status  : Word;
  19.      Reserved: Array[1..8] of Byte;
  20.   End;
  21.  
  22. Const
  23.   Init       = 0;
  24.   IoCtlInput = 3;
  25.   InputFlush = 7;
  26.   IOCtlOutput= 12;
  27.   DevOpen    = 13;
  28.   DevClose   = 14;
  29.   ReadLong   = 128;
  30.   ReadLongP  = 130;
  31.   SeekCmd    = 131;
  32.   PlayCD     = 132;
  33.   StopPlay   = 133;
  34.   ResumePlay = 136;
  35.  
  36. Type
  37.  
  38.   Audio_Play = Record
  39.     APReq    : Req_Hdr;
  40.     AddrMode : Byte;
  41.     Start    : LongInt;
  42.     NumSecs  : LongInt;
  43.   end;
  44.  
  45.   IOControlBlock = Record
  46.     IOReq_Hdr : Req_Hdr;
  47.     MediaDesc : Byte;
  48.     TransAddr : Pointer;
  49.     NumBytes  : Word;
  50.     StartSec  : Word;
  51.     ReqVol    : Pointer;
  52.     TransBlock: Array[1..130] OF Byte;
  53.   End;
  54.  
  55.   ReadControl = Record
  56.     IOReq_Hdr : Req_Hdr;
  57.     AddrMode  : Byte;
  58.     TransAddr : Pointer;
  59.     NumSecs   : Word;
  60.     StartSec  : LongInt;
  61.     ReadMode  : Byte;
  62.     IL_Size,
  63.     IL_Skip   : Byte;
  64.   End;
  65.  
  66.   AudioDiskInfoRec = Record
  67.     LowestTrack    : Byte;
  68.     HighestTrack   : Byte;
  69.     LeadOutTrack   : LongInt;
  70.   End;
  71.  
  72.   PAudioTrackInfo   = ^AudioTrackInfoRec;
  73.   AudioTrackInfoRec = Record
  74.     Track           : Integer;
  75.     StartPoint      : LongInt;
  76.     EndPoint        : LongInt;
  77.     Frames,
  78.     Seconds,
  79.     Minutes,
  80.     PlayMin,
  81.     PlaySec,
  82.     TrackControl    : Byte;
  83.   end;
  84.  
  85.   MSCDEX_Ver_Rec = Record
  86.     Major,
  87.     Minor       : Integer;
  88.   End;
  89.  
  90.   DirBufRec    = Record
  91.      XAR_Len   : Byte;
  92.      FileStart : LongInt;
  93.      BlockSize : Integer;
  94.      FileLen   : LongInt;
  95.      DT        : Byte;
  96.      Flags     : Byte;
  97.      InterSize : Byte;
  98.      InterSkip : Byte;
  99.      VSSN      : Integer;
  100.      NameLen   : Byte;
  101.      NameArray : Array[1..38] of Char;
  102.      FileVer   : Integer;
  103.      SysUseLen : Byte;
  104.      SysUseData: Array[1..220] of Byte;
  105.      FileName  : String[38];
  106.   end;
  107.  
  108.   Q_Channel_Rec = Record
  109.     Control     : Byte;
  110.     Track       : Byte;
  111.     Index       : Byte;
  112.     Minutes     : Byte;
  113.     Seconds     : Byte;
  114.     Frame       : Byte;
  115.     Zero        : Byte;
  116.     AMinutes    : Byte;
  117.     ASeconds    : Byte;
  118.     AFrame      : Byte;
  119.   End;
  120.  
  121. Var
  122.   AudioChannel   : Array[1..9] of Byte;
  123.   RedBook,
  124.   Audio,
  125.   DoorOpen,
  126.   DoorLocked,
  127.   AudioManip,
  128.   DiscInDrive    : Boolean;
  129.   AudioDiskInfo  : AudioDiskInfoRec;
  130.   DriverList     : Array[1..26] of ListBuf;
  131.   NumberOfCD     : Integer;
  132.   FirstCD        : Integer;
  133.   UnitList       : Array[1..26] of Byte;
  134.   MSCDEX_Version : MSCDEX_Ver_Rec;
  135.   QChannelInfo   : Q_Channel_Rec;
  136.   Busy,
  137.   Playing,
  138.   Paused         : Boolean;
  139.   Last_Start,
  140.   Last_End       : LongInt;
  141.   DirBuf         : DirBufRec;
  142.  
  143. Implementation
  144.  
  145. Begin
  146.   FillChar(DriverList, SizeOf(DriverList), #0);
  147.   FillChar(UnitList, SizeOf(UnitList), #0);
  148.   NumberOfCD  := 0;
  149.   FirstCD  := 0;
  150.   MSCDEX_Version.Major := 0;
  151.   MSCDEX_Version.Minor := 0;
  152. end.